package com.alex.statistics.pojo.request.structureanalysis;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 静态结构分析请求参数
 */
@Data
public class StaticStructureRequest {

    // 占比分析请求参数（内部类）
    @Data
    @Schema(description = "占比分析请求参数")
    public static class ProportionRequest {
        @Schema(description = "各组成部分的名称", required = true, example = "[\"产品A\",\"产品B\",\"产品C\"]")
        private List<String> componentNames;

        @Schema(description = "各组成部分的数值", required = true, example = "[150, 250, 100]")
        private List<Double> componentValues;

        @Schema(description = "整体总值（若为null则自动计算总和）", example = "500.0")
        private Double totalValue;
    }

    // 构成比分析请求参数（内部类）
    @Data
    @Schema(description = "构成比分析请求参数")
    public static class CompositionRatioRequest {
        @Schema(description = "分类名称（多分类变量）", required = true, example = "[\"华东\",\"华北\",\"华南\",\"西部\"]")
        private List<String> categoryNames;

        @Schema(description = "各分类的数值", required = true, example = "[300, 200, 150, 350]")
        private List<Double> categoryValues;
    }

    // 帕累托分析请求参数（内部类）
    @Data
    @Schema(description = "帕累托分析请求参数")
    public static class ParetoRequest {
        @Schema(description = "各因素的名称", required = true, example = "[\"缺陷A\",\"缺陷B\",\"缺陷C\",\"缺陷D\",\"缺陷E\"]")
        private List<String> factorNames;

        @Schema(description = "各因素的影响值（如数量、金额等）", required = true, example = "[120, 80, 50, 30, 20]")
        private List<Double> impactValues;

        @Schema(description = "关键因素累计占比阈值（默认80%）", example = "80.0")
        private Double threshold = 80.0;
    }
}
    